<?php if(isset($success_message) && $success_message == 1 ){  ?>
        <div class="noty_bar noty_theme_default noty_layout_topCenter noty_success" id="noty_success_1355937644582" style="cursor: pointer; left: 559.5px; display: block;">
            <div class="noty_message"><span class="noty_text">Rol creado con exito!</span></div>
        </div>
<?php }elseif(isset($success_message) && $success_message == 0){ ?>
<div class="noty_bar noty_theme_default noty_layout_topCenter noty_error" id="message_error_formAddPurchase" style="cursor: pointer; left: 559.5px; display: block;">
    <div class="noty_message"><span id="contentMessageErrorFormAddPurchase" class="noty_text">No se pudo grabar el nuevo rol</span></div>
</div>
<?php } ?>
<?php if(isset($edit) && $edit == 1) { ?>
       <div class="noty_bar noty_theme_default noty_layout_topCenter noty_success" id="noty_success_1355937644582" style="cursor: pointer; left: 559.5px; display: block;">
            <div class="noty_message"><span class="noty_text">Rol editado con exito!</span></div>
        </div> 
<?php } ?>

<script type="text/javascript">
   $(document).ready(function(){
	   
	    setTimeout(function() {
        $('#noty_success_1355937644582').fadeOut(1500);	
   		},3000);
	   
		$('#guardar_rol').click(function(){
			var description = $.trim($('input[name=description]').val());
			 if(description != ''){
				 $('input[name=description]').css('background','#ffffff');
					$('#formAddRols').submit();
				 }else{
				$('#noty_success_1355937644582').fadeOut('fast');	
			  	$('input[name=description]').css('background','#ff0000');
				alert('Debe completar el campo description');
			 }
		})
	})
</script>


<div class="grid_container">
   
    
    <form id="formAddRols" class="form_container" action="<?php echo base_url();?>index.php/rols/submit" method="post">
    
    <div class="grid_12">
        <div class="widget_wrap">
                <div class="widget_top">
                        <span class="h_icon user_2"></span>
                        <h6><?=isset($rol->id_rol) ? 'Editar' : 'Agregar' ?> Rol</h6>
                </div>
            <div class="widget_content">
                <ul>
                        <li>
                            <div class="form_grid_12">
                                    <div class="form_input">
                                            <div class="form_grid_12 alpha">
                                                    <span class="label_head">Descripción <span class="req">*</span></span>
                                                 
                                                    <input type="text" name="description" id="description" class="noEmpty" value="<?php if(isset($rol->description)){  echo $rol->description; } ?>" tabindex="1" />
                                                   
                                                  
                                                
                                            </div>
                                            <span class="clear"></span>
                                    </div>
                            </div>
			</li>
                        			
                </ul>
                <span class="clear"></span>
            </div>
        </div>
        <br />
		
  
        <?php echo form_hidden("id_rol", @field($rol->id_rol)); ?>
        <button id="guardar_rol" type="button" class="btn_small btn_orange"><span>Guardar</span></button>
       
    </div>
    </form>
    <span class="clear"></span>         
</div>